import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: 'ID',
    align: "center",
    dataIndex: 'id'
  },
  {
    title: '会员编号',
    align: "center",
    dataIndex: 'username'
  },
  {
    title: '用户姓名',
    align: "center",
    dataIndex: 'realname'
  },
  {
    title: '昵称',
    align: "center",
    dataIndex: 'nickname'
  },
  {
    title: '性别',
    align: "center",
    dataIndex: 'gender_dictText'
  },
  {
    title: '手机号',
    align: "center",
    dataIndex: 'phone'
  },
  {
    title: '工作单位',
    align: "center",
    dataIndex: 'workunit'
  },
  {
    title: '所属省',
    align: "center",
    dataIndex: 'province',
  },
  {
    title: '积分',
    align: "center",
    dataIndex: 'memberScore'
  },
  {
    title: '会员类别',
    align: "center",
    dataIndex: 'memberType_dictText'
  },
  {
    title: '介绍人',
    align: "center",
    dataIndex: 'introducer'
  },
  {
    title: '启用状态',
    align: "center",
    dataIndex: 'isEnabled',
    customRender:({text}) => {
       return  render.renderSwitch(text, [{text:'是',value:'Y'},{text:'否',value:'N'}]);
     },
  },
  {
    title: '注册时间',
    align: "center",
    dataIndex: 'registerTime'
  },
];

// 高级查询数据
export const superQuerySchema = {
  id: {title: 'ID',order: 0,view: 'number', type: 'number',},
  username: {title: '会员编号',order: 0,view: 'text', type: 'string',},
  realname: {title: '用户姓名',order: 1,view: 'text', type: 'string',},
  nickname: {title: '昵称',order: 2,view: 'text', type: 'string',},
  gender: {title: '性别',order: 3,view: 'list', type: 'string',dictCode: 'sex',},
  phone: {title: '手机号',order: 6,view: 'text', type: 'string',},
  workunit: {title: '工作单位',order: 9,view: 'text', type: 'string',},
  province: {title: '所属省',order: 10,view: 'pca', type: 'string',},
  memberScore: {title: '积分',order: 13,view: 'number', type: 'number',},
  memberType: {title: '会员类别',order: 14,view: 'list', type: 'string',dictCode: 'member_type',},
  introducer: {title: '介绍人',order: 15,view: 'text', type: 'string',},
  isEnabled: {title: '启用状态',order: 16,view: 'number', type: 'number',},
  registerTime: {title: '注册时间',order: 17,view: 'datetime', type: 'string',},
};
